package com.linux.huhx.task;

import com.linux.huhx.base.interfaces.IBaseSourceParse;
import com.linux.huhx.base.interfaces.IBaseTask;
import com.linux.huhx.incepters.FirstLowerLetterIncepter;
import com.linux.huhx.output.ConsoleOutput;
import com.linux.huhx.output.FileOutput;
import com.linux.huhx.parse.EmptySourceParse;
import com.linux.huhx.source.ConsoleSource;

import java.io.File;
import java.util.List;

/**
 * Created by huhx on 2017-06-15.
 */
public class FileTask implements IBaseTask {
    @Override
    public void doTaskExecute() {
        // source
        ConsoleSource source = new ConsoleSource();
        IBaseSourceParse baseSourceParse = new EmptySourceParse();
        source.setBaseSourceParse(baseSourceParse);
        List<String> sourceLists = source.getStringsFromSource("");
        // incepter
        FirstLowerLetterIncepter lowerLetterIncepter = new FirstLowerLetterIncepter();
        List<String> strings = lowerLetterIncepter.doIncepter(sourceLists);
        // output
        FileOutput output = new FileOutput();
        output.writeFileFromSource(strings, new File("D:/linux/huhx.txt"));
    }
}
